<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div style="padding: 2px 2px 2px 50px;">
	<form class="op-form" id="queryForm" name="queryForm" method="post">
		<table>
			<tr>
				<td>类型:</td>
				<td>
					<input class="easyui-validatebox" name="fieldName">
				</td>
			</tr>
			<tr>
				<td>显示值:</td>
				<td>
					<input class="easyui-validatebox" name="showValue">
				</td>
			</tr>
			<tr>
				<td>状态:</td>
				<td>
					<select id="status" name="status">
						<option value="0">停用</option>
						<option value="1">在用</option>
						<option value="3" selected="selected">全部</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td>
					<a href="#" class="easyui-linkbutton" icon="icon-query" onclick="$('#queryForm').submit()">查询</a>
				</td>
				<td>
					<a href="#" class="easyui-linkbutton" icon="icon-cancel" onclick="queryForm.reset();ajaxQuery();">重置</a>
					<a href="#" class="easyui-linkbutton" icon="icon-redo" onclick="$('#queryWindow').window('close');">返回</a>
				</td>
			</tr>
		</table>
	</form>
</div>

<script type="text/javascript">
	
	$(document).ready(function(){
		$('#queryForm').form({
			onSubmit: function(){
				if($(this).form('validate')){
					ajaxQuery();
				}else{
					return false;
				}
			}
		});
	});
	
	function ajaxQuery(){
		var actionURL = "constant.action?command=grid";
		var params = $("#queryForm").dataForAjax().json;
		
		$('#tt').datagrid({
		    url: actionURL,
		    queryParams: params
		});
	}
</script>